const mongoose=require('mongoose');

//mongo数据库开启连接的方法
function dbConnect() {
    mongoose.connect('mongodb://localhost/shoponline');
    mongoose.connection.once('open',function (err) {
        if (err){
            console.log('MongoDB is not opening!......');
        }else{
            console.log('MongoDB is opening!......');
        }
    })
}

exports.dbConnect=dbConnect;